Python 3.9.6 (default, Jun 29 2021, 10:42:27) 
[GCC 10.2.1 20210313 (ALT Sisyphus 10.2.1-alt3)] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1000
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1000
число четырех значное
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
999
число не четырех значное
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
9999
число четырех значное
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1000
число четырех значное
1 0 0 0
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
999
число не четырех значное
0 9 9 9
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
999
число не четырех значное
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1234
число четырех значное
1 2 3 4
Traceback (most recent call last):
  File "/home/student/rtg.py", line 15, in <module>
    k=k+1
NameError: name 'k' is not defined
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1737
1 7 3 7
17 73 37
173 737
173
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
2031
2 0 3 1
20 3 31
203 31
31
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1737
173
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1737
1 7 3 7
17 73 37
173 737
173
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1737
173
>>> 
=================================================== RESTART: /home/student/rtg.py ===================================================
1234
23
>>> 